package com.le.tester.javaThink.fifth.chapter14_StreamingProgramming;

/**
 * 描述：
 */
class Dog {
    int age = -1;
    String name;

    Dog() {
        name = "stray";
    }

    Dog(String nm) {
        name = nm;
    }

    Dog(String nm, int year) {
        name = nm;
        age = year;
    }

}

interface MakeNoArgs {
    Dog make();
}

interface Make1Arg {
    Dog make(String name);
}

interface Make2Agr {
    Dog make(String nm, int age);
}

public class CtorReference {
    public static void main(String[] args) {
        MakeNoArgs makeNoArgs = Dog::new;
        Make1Arg make1Arg = Dog::new;
        Make2Agr make2Agr = Dog::new;

        Dog make = makeNoArgs.make();
        Dog comet = make1Arg.make("Comet");
        Dog ralph = make2Agr.make("Ralph", 4);
    }

}
